/*
 * DATA.h
 *
 *  Created on: Jul 10, 2009
 *      Author: avishai
 */

#ifndef DATA_H_
#define DATA_H_

#include <string>
#include <iostream>
using namespace std;

#define DISKFILE		"FILE_SYS"
#define INT_SIZE    4
#define BYTE_SIZE	1
#define I_NODE_SIZE 50

// types of i-node:
#define FILE 		1
#define DIRECTORY	2
#define SOFT_LINK	3


typedef struct file{
	string fileName;
	int inode;
}iFile;

typedef struct block{
	void* blockContent[16];
}Block;

typedef struct node{
	int data;
	struct node * next;
} Node;

typedef struct inode{
	unsigned char fType; //1 byte
	unsigned char numOfHardLinks;//1 byte
	int fileSize;//4 bytes
	Block firstTen[10];//40 bytes
	struct inode *restOfBlocks;//4 byte pointer

}Inode;



typedef struct superBlock{
	//General Data:
	int fileSystemSize;
	int blockSize;
	int Inode_root;

	//Block Control:
	int freeBlocksNum;
	//BLOCK of freeBlocks
	int Freeblocks;
	int nextFreeBlock;
	int lastBlock;

	//INODE control
	int numOfInodes;
	int numOfFreeInodes;
	int FreeInodes;
	int nextFreeInode;
	int lastInodeBlock;
}SuperBlock;


using namespace std;

#endif /* DATA_H_ */
